/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.workflowMonitoring.service;

import com.koron.workflow.common.bean.PageBean;
import com.koron.workflow.common.bean.StaffBean;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.List;
import java.util.Map;

/**
 * 工作流设计
 */
public interface WorkflowMonitoringService {

    /**
     * 查询用户有监控权限的模版组
     *
     * @param factory
     * @param user
     * @return
     */
    List<Map> queryMonitoringProcessList(SessionFactory factory, StaffBean user);

    /**
     * 根据条件查询 模版管理 列表
     *
     * @param appId    应用ID
     * @param setId    所属模版ID
     * @param code     模版编号
     * @param name     模版名称
     * @param title    标题
     * @param page
     * @param pageSize
     * @return
     */
    PageBean queryForList(SessionFactory factory, StaffBean user, String appId,
                                            String setId, String code, String name,
                                            String title, Integer page, Integer pageSize);

    /**
     * 结束
     * @param tasklistId 任务列表ID
     * @return
     */
    MessageBean endTask(SessionFactory factory, String tasklistId);


    /**
     * 删除
     * @param processInstanceId 流程实例Id
     * @return
     */
    MessageBean delete(SessionFactory factory, String processInstanceId);

    /**
     * 查询当前节点及之前的历史节点信息
     * @param curTaskId 当前任务id
     * @param processInstanceId 流程实例Id
     * @return
     */
    List queryHisNodeMsgs(SessionFactory factory, String curTaskId, String processInstanceId);

    /**
     * 根据流程实列ID 获取要进行驳回参数信息
     * @param processInstanceId 流程实例Id
     * @return
     */
    Map getRejectParams(SessionFactory factory, String processInstanceId);
}
